home *** CD-ROM | disk | FTP | other *** search
/ Amiga Aktuell / Amiga Aktuell.iso / amiga-aktuell / net tools / fido net / moodkludges / moodkludges.spot < prev    next >
Text File  |  1996-09-05  |  5KB  |  169 lines

  1. /*           MOOD KLUDGES :-) ©1996 Alex Stansfield                */
  2. /*                                                                 */
  3. /* Add cool kludges into the message to describe your moods today  */
  4. /*     _    _    ___  _  _                                         */
  5. /*    /_\  ( )  (  _)( )( ) Fidonet:- 2:254/524.15  .------------. */
  6. /*   /_X_\ ((__  ) _) >)(<  AmigaNet:- 39:139/1.15  | Team AMIGA | */
  7. /*  (_) (_)(___)(___)(_)(_) AmNet:- 69:102/10.15    `------------' */
  8. /*                                                PGP Key avalible */
  9. /*        EMail:- Kurt@darkside.demon.co.uk                        */
  10. /*                                                                 */
  11.  
  12. MSGORIGIN = 'Mood Kludges :-)'
  13. TEMP = 'T:spot.kludge.temp1'
  14. TEMP2 = 'T:spot.kludge.temp2'
  15.  
  16. address spot
  17. options results
  18.  
  19. WinDi.trd_top=0
  20. WinDi.trd_left=1
  21. WinDi.trd_width=0
  22. WinDi.trd_height=1
  23. WinDi.trd_left2=0
  24. WinDi.trd_top2=0
  25. WinDi.trd_width2=0
  26. WinDi.trd_height2=0
  27. WinDi.trd_zoomed=0 
  28.  
  29. IF ~SHOW('LIBRARIES','tritonrexx.library') THEN DO
  30.     IF ~EXISTS('LIBS:tritonrexx.library') THEN DO
  31.         'requestnotify TITLE "Arrrrggggg" PROMPT "Hey!!! Mood Kludges needs TritonRexx.library"'
  32.         exit
  33.     END
  34.     IF ~ADDLIB('tritonrexx.library',10,-30,0) THEN DO
  35.         say "triton rexx unopened"
  36.           EXIT
  37.     END
  38. end
  39.  
  40. tags =         windowid(1),
  41.         windowtitle('Mood Kludges v1.0') WindowDimensions(WinDi),
  42.                 windowflags('TRWF_NOSIZEGADGET'),
  43.                 screentitle('Mood Kludges v1.0 ©1996 Alex Stansfield'),
  44.                 pubscreenname('SPOT'),
  45.                 'VertGroupA',
  46.         'TROB_Button 0 TRAT_Text "'Add Kludge'" TRAT_ID "'add'"',
  47.         'EndGroup',
  48.         'EndProject',
  49.  
  50. app = tr_createapp('TRCA_Name Buttons')
  51.  
  52. if app~='00000000'x then do
  53.     window=tr_openproject(app,tags)
  54.     if window~='00000000'x then do
  55.         do forever
  56.             CALL READ
  57.             do while tr_handlemsg(app,'event')
  58.                 if event.trm_class = 'TRMS_ACTION' then do
  59.                     CALL ADDKLUDGE
  60.                 end
  61.                 if event.trm_class='TRMS_CLOSEWINDOW' then CALL ENDS
  62.                 end
  63.             end
  64.         end 
  65.     end
  66. end
  67.  
  68. ADDKLUDGE:
  69.  
  70. 'ismessages'
  71. if rc = 5 then do
  72.     'requestnotify TITLE "Mood Kludges :-)" "Use from message window only ..."'
  73.     RETURN
  74.     end
  75.  
  76. /* Save the msg */
  77. 'saveascii TO 'TEMP' OVERWRITE NOHEADER NOTEARLINE NOORIGIN NOKLUDGES' 
  78.  
  79. /* Get Header details */
  80.  
  81. /* Get To Name */
  82. 'getto'
  83. TO_NAME = result
  84. /* Get To Address */
  85. 'gettoaddress'
  86. TO_ADD = result
  87. /* Get the subject */
  88. 'getsubject'
  89. TO_SUB = result
  90.  
  91. /* Ask what mood your in */
  92. 'RequestString TITLE "Mood Kludges" PROMPT "What is your mood today then?"'
  93. If RC>0 Then RETURN
  94. KLUDGE = '01'x'MOOD: 'result''
  95.  
  96. /* Read the text */
  97. IF OPEN(temptext,temp,'Read') ~= 1 THEN
  98.     DO
  99.         requestdata = 'PROMPT "Could not open' tempfile1 'for reading.."'
  100.         'requestnotify' requestdata
  101.         SIGNAL exit
  102.     END
  103.  
  104. Text = READCH(temptext,60000)
  105. CALL CLOSE temptext
  106.  
  107. /* Add the Kludge */
  108.     IF OPEN(tempkludge,temp2,'Write') ~= 1 THEN
  109.         DO
  110.             requestdata = 'PROMPT "Could not open' temp 'for writing.."'
  111.             'requestnotify' requestdata
  112.             SIGNAL exit
  113.         END
  114.     CALL WRITELN(tempkludge,kludge)
  115.     CALL WRITECH(tempkludge,text) /* Add the text */
  116.     CALL CLOSE tempkludge
  117.  
  118. /* Write message back */
  119. 'write  TO "'TO_NAME'" SUBJECT "'TO_SUB'" TOADDR "'TO_ADD'" ORIGIN "'MSGORIGIN'" FILE "'TEMP2'" NOSIG NOEDIT NOGUI'
  120.  
  121. /* Delete the temp files */
  122.  
  123. Address Command 'Delete >NIL:' TEMP2
  124. Address Command 'Delete >NIL:' temp
  125.  
  126.  
  127. /* Delete Original Message ? */
  128. 'requestresponse TITLE "Delete?" PROMPT "Delete Original Message?" GADGETS "_Good idea|_No Thanx" CENTER'
  129.  
  130. if rc=1 then do
  131. 'deletemessage NOREQ NODELKEEP'
  132. end
  133.  
  134. /* Go back */
  135. RETURN
  136.  
  137. READ: /* Read though the message looking for the kludge */
  138. 'ismessages' /* see if it is messages screen */
  139. if result ~=5 then
  140.     do
  141.     'getareaname'
  142.                newarea = result
  143.     'getmessagenum'
  144.     newnum = result
  145.     if ((newnum~=oldnum) | (oldarea~=newarea)) & (newnum~=newarea) then do
  146.         /* to see if the message number or area had changed - it's a different message */
  147.         oldnum=newnum  /* reset the variables */
  148.         oldarea=newarea
  149.         'getfrom' 
  150.         name = result /* Blokey who sent it */
  151.         'getkludge MOOD' /* look for the MOOD: kludge */
  152.         if rc=0 then /* if there is one then ... */
  153.             do
  154.             parse var result "MOOD:" feeling /* see what the feeling is */
  155.             'requestnotify TITLE "Mood Kludge" PROMPT "'name' is'feeling'"' /* Print it up */ 
  156.         end
  157.     end
  158. end
  159. RETURN /* Go back */
  160.  
  161. ENDS: /* Quit the Script */
  162. 'requestresponse TITLE "Quit?" PROMPT "Are you Sure you want to Quit?" GADGETS "_Sure am|_No Way" CENTER'
  163. if rc=1 then do
  164. call tr_closeproject(window)
  165. call tr_deleteapp(app)
  166. exit(0)
  167. end
  168. RETURN
  169.